package com.ethink.order.facade.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ethink.order.api.info.GroupMateDetailInfo;
import com.ethink.order.api.response.GroupMateDetailResponse;
import com.ethink.order.common.entity.GroupMateDetail;
import com.ethink.order.service.GroupMateDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.GroupMateFacade;
import com.ethink.order.api.info.GroupMateInfo;
import com.ethink.order.api.request.GroupMateAddRequest;
import com.ethink.order.api.request.GroupMateQueryRequest;
import com.ethink.order.api.request.GroupMateUpdateRequest;
import com.ethink.order.api.response.GroupMateAddResponse;
import com.ethink.order.api.response.GroupMateDeleteResponse;
import com.ethink.order.api.response.GroupMateUpdateResponse;
import com.ethink.order.service.GroupMateService;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 组套商品表 Facade接口实现
 *
 * @author default
 * @date 2023-02-22
 */
@RestController
@Slf4j
@RequestMapping("order-service/facade/v1/groupMate")
public class GroupMateFacadeImpl implements GroupMateFacade {

    @Autowired
    private GroupMateService groupMateService;

    @Resource
    private GroupMateDetailService groupMateDetailService;

    @Override
    public Page<GroupMateInfo> queryGroupMate(GroupMateQueryRequest request) {
        return groupMateService.queryGroupMate(request);
    }

    @Override
    public GroupMateDetailResponse getGroupMateById(Long groupMateId) {
        return groupMateService.getGroupMateById(groupMateId);
    }

    @Override
    public List<GroupMateInfo> listGroupMate(GroupMateQueryRequest request) {
        return groupMateService.listGroupMate(request);
    }

    @Override
    public GroupMateAddResponse addGroupMate(GroupMateAddRequest request) {
        return groupMateService.addGroupMate(request);
    }

    @Override
    public Boolean updateGroupMate(GroupMateUpdateRequest request) {
        return groupMateService.updateGroupMate(request);
    }

    @Override
    public boolean deleteGroupMate(Long groupMateId) {
        return groupMateService.deleteGroupMate(groupMateId);
    }

    @Override
    public List<String> getGroupMateSkuList(String saleSubChannel) {
        return groupMateService.getGroupMateSkuList(saleSubChannel);
    }

    @Override
    public GroupMateDetailResponse getGroupMateByGroupMateSku(String saleSubChannel, String groupMateSku) {
        return groupMateService.getGroupMateByGroupMateSku(saleSubChannel, groupMateSku);
    }

}